<?php
/**
 * Created by PhpStorm.
 * User: sunbo
 * Date: 2019/8/21
 * Time: 11:27 AM
 */

namespace app;
use think\facade\Log;
use think\exception\Handle;
class HandleException extends Handle
{
    public function render(\Exception $e)
    {
        Log::error("出错原因:".$e->getMessage(). "出错详情:".$e->getTraceAsString());
        $data =  [
            'code' => 500,
            'error' => "服务器内部错误,请联系我们",
            'data' =>""
        ];
        return json($data,500);
    }

}